# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=unicode-character-database
pkgver=15.1.0
pkgrel=1
pkgdesc="Unicode Character Database"
arch="noarch"
license="Unicode-DFS-2015"
url="https://www.unicode.org/"
makedepends="libarchive-tools"
source="UCD-$pkgver.zip::https://www.unicode.org/Public/zipped/$pkgver/UCD.zip
	Unihan-$pkgver.zip::https://www.unicode.org/Public/zipped/$pkgver/Unihan.zip
	emoji-sequences-${pkgver%.*}.txt::https://www.unicode.org/Public/emoji/${pkgver%.*}/emoji-sequences.txt
	emoji-zwj-sequences-${pkgver%.*}.txt::https://www.unicode.org/Public/emoji/${pkgver%.*}/emoji-zwj-sequences.txt
	emoji-test-${pkgver%.*}.txt::https://www.unicode.org/Public/emoji/${pkgver%.*}/emoji-test.txt
	"
options="!check" # no tests to speak off
replaces="unicode-emoji"
builddir="$srcdir"

package() {
	for _f in UCD Unihan; do
		install -Dm644 $_f-$pkgver.zip "$pkgdir/usr/share/unicode/$_f.zip"
		bsdtar -C "$pkgdir/usr/share/unicode" -x --no-same-owner --no-same-permissions -f $_f-$pkgver.zip
	done

	for _f in sequences test zwj-sequences; do
		install -Dm644 emoji-$_f-${pkgver%.*}.txt "$pkgdir"/usr/share/unicode/emoji/emoji-$_f.txt
	done
}

sha512sums="
6285b78d5765092d04632f2bdf23f43fe4c3d8acc28700ff941b5a647bf86aba348ea280cee54f5761e534070439cd5628cb25cb7cd9d7dca08e05000f434f54  UCD-15.1.0.zip
fc1a32fc68b3e1d2d358fca91c2cd6c1103557405e91ff558585f18a2e9b1ee6f8af89e7ee922ff36cade67a5cf4f5b4042ba97d350af7b92b18f161eef5ec78  Unihan-15.1.0.zip
19cf9b366a76d472d35e3e5d2adcb70e962397bce60a65e7685e9b203310dab2b63ee45fae8691c06dc6fedfac4e5c3730f9aadde119e3a7f4560c9ff325fd8a  emoji-sequences-15.1.txt
b9be3543cb44b8b394be12f06b9d3a27aa7da134cc5060d51681e2759c2aa0ce2604edf9f8782f8d3606e9765f2703b35807a932d36914b24261e59a07fffed1  emoji-zwj-sequences-15.1.txt
1e267845f2cc72aed60455a60e7cb8774433e0a1d0a9be98de6169304047184c8a7d5919117dd085dccfc4a7b507cb8938a3a6e34fd6fd9216fda27f8c126e5e  emoji-test-15.1.txt
"
